package cn.gok.testgit;

import java.util.Random;
import java.util.Scanner;

public class homework {
    public static void main(String[] args) {
        产生并输出随机密码();
    }

    private static void 产生并输出随机密码() {
        System.out.println("请输入密码长度:大于等于6");
        int n = new Scanner(System.in).nextInt();
        if (n >= 6) {
            suijimima(n);
        } else {
            System.out.println("输入有误");
        }
    }

    private static void suijimima(int n){
        char cs[] = new char[36];

        String str = "";
        for(int i = 0;i<26;i++){
            cs[i] = ((char) ('A'+i));
        }
        for(int i= 0;i<10;i++){
            cs[i+26] += i+'0';
        }
        for(int i = 0;i<=n-1;i++){
            int x = new Random().nextInt(36);
            str = str+cs[x];
        }
        System.out.println(str);
    }
}
